#include<stdio.h>
#include<unistd.h>

int main()
{
  printf("I am running...\n");
  pid_t id = fork();
  if(id == 0){//child
    while(1){
      printf("dp spmething!\n");
      sleep(1);
    }
  }
  else if(id > 0){//parent
    while(1){
      printf("call child,do something!\n");
      sleep(2);
    }
  }
  else{
    //fork  error!
  }
 // while(1){
 //   printf("I am a process: pid:%d,ppid:%d\n",getpid(),getppid());
 //   sleep(1);
 // }

  return 0;
}
